package com.atguigu.distributed.lock.stock;

import com.atguigu.distributed.lock.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StockController {

    @Autowired
    private StockService stockService;

    @GetMapping("stock/deduct")
    public String deduct() {
        try {
            this.stockService.deduct();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "hello stock deduct!!";
    }

}
